package com.sollink.sat.model;

public class Variable {

	public int var;
	
	public int value;  // -var, 0, +var
	public int level;
	public Clause reason;
	
	public Variable(int var) {
		this.var= var;
		
		value = 0;
		reason = null;
		level = -1;
	}
	
	public void assign(int value) {
		this.value= value;
	}
	
	public void set_decision_level(int decision_level) {
		level = decision_level;
	}
	
	public void set_reason(Clause from) {
		reason = from;
	}
	
	public int decision_level() {
		return level;
	}
	
	public Clause reason() {
		return reason;
	}
	
	public void undo() {
		value = 0;
		reason = null;
		level = -1;
	}

	public int value() {
		return value;
	}
}